<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>

<!DOCTYPE html>
<html lang="en">
<head>
<jsp:include page="/pages/elements/head.jsp" />
</head>

<body>
	<jsp:include page="/pages/elements/scripts.jsp" />

	<jsp:include page="/pages/elements/menu.jsp" />

	<div class="tabbable tabs-left">
		<ul class="nav nav-tabs" id="q1_menu">
			<li><a href="#info" class='info' data-toggle="tab">Info</a></li>
			<li><a href="#q1" class='q1' data-toggle="tab">Query 1</a></li>
			<li><a href="#q2" class='q2' data-toggle="tab">Query 2</a></li>
			<li><a href="#q3" class='q3' data-toggle="tab">Query 3</a></li>
			<li><a href="#q4" class='q3' data-toggle="tab">Query 4</a></li>
			<li><a href="#q5" class='q4' data-toggle="tab">Query 5</a></li>
			<li><a href="#q6" class='q5' data-toggle="tab">Query 6</a></li>
		</ul>

		<div class="tab-content">
			<div class="tab-pane" id="info">
				<p>query 1 (where): ${fn:escapeXml("#{ db.(Service where minServiceCost >= ")}${serviceCost}${fn:escapeXml(")}")}</p>
				<p>query 2 (kropka): ${fn:escapeXml("#{ db.(Service.serviceName) }")}</p>
				<p>query 3 (przecinek): ${fn:escapeXml("#{ db.(Employee.(firstName, lastName)) }")}</p>
				<p>query 4 (join): ${fn:escapeXml("#{db.(Deal join max(customer.ranks.discount))}")}</p>
				<p>query 5 (as): ${fn:escapeXml("#{ db.( min(Rank.discount) as minimum, avg(Rank.discount) as average, max(Rank.discount) as maximum )};")}</p>
				<p>query 6 (group as): ${fn:escapeXml("#{db.((Rank as r).(count(r.customers) group as ilosc, r as rank).(ilosc as ilosc, rank as rank))};")}</p>
			</div>
			<div class="tab-pane" id="q1">
				<jsp:include page="services1.jsp" />
			</div>
			<div class="tab-pane" id="q2">
				<jsp:include page="servicesNames.jsp" />
			</div>
			<div class="tab-pane" id="q3">
				<jsp:include page="empNames.jsp" />
			</div>
			<div class="tab-pane" id="q4">
				<jsp:include page="deals.jsp" />
			</div>
			<div class="tab-pane" id="q5">
				<jsp:include page="discounts.jsp" />
			</div>
			<div class="tab-pane" id="q6">
				<jsp:include page="rankCount.jsp" />
			</div>
		</div>
	</div>
</body>
</html>
